package nz.ac.vuw.ecs.kcassell.personcars;

/**
 * This class has characteristics of both a Person and a Car. ToString is the
 * only method that accesses both Person and Car methods. Only the accessors
 * access fields directly. The other methods access them via the accessors.
 * 
 * @author Keith
 */

public class PersonCarIndirect {
	// Person fields
	private String firstName;
	private String lastName;
	private int id;

	// Car fields
	private String make;
	private String model;

	/** The vehicle id number */
	private int vin;

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String surname) {
		this.lastName = surname;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getMake() {
		return make;
	}

	public void setMake(String make) {
		this.make = make;
	}

	public String getModel() {
		return model;
	}

	public void setModel(String model) {
		this.model = model;
	}

	public int getVin() {
		return vin;
	}

	public void setVin(int vin) {
		this.vin = vin;
	}

	public String getPersonInfo() {
		return "" + getId() + ": " + getPersonName();
	}

	public String getPersonName() {
		return getFirstName() + " " + getLastName();
	}

	public String getCarInfo() {
		return "" + getVin() + ": " + getCarDescription();
	}

	public String getCarDescription() {
		return getMake() + " " + getModel();
	}

	public String toString() {
		return getPersonInfo() + " owns a " + getCarInfo();
	}

}
